/*
 * IdMgr.h
 *
 *  Created on: 2011-01-02
 *      Author: kamil
 */

#ifndef IDMGR_H_
#define IDMGR_H_

#include <string>
#include <map>
#include <log4cxx/logger.h>

#include "ModelId.h"

/// Global method to shorten accessing IdMgr
std::string getName(ModelId id);

/**
 * Class used to manage robot ids - faster and
 * easier to operate than string ids (compare etc.)
 */
class IdMgr {
public:
	static IdMgr & instance();
	ModelId getId(const std::string & robotName);
	std::string getName(ModelId id);
	~IdMgr();
private:
	IdMgr();

	static int lastId;
	std::map<std::string, ModelId> assignedIds;
	std::map<ModelId, std::string> names;

	static log4cxx::LoggerPtr logger;
};

#endif /* IDMGR_H_ */
